const wpconfig = require('../build/webpack.config.js');
module.exports = {
  "stories": [
    "../src/**/*.stories.mdx",
    "../src/**/*.stories.@(js|jsx|ts|tsx)"
  ],

  "addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",    
  ],

  "framework": {
    name: "@storybook/react-webpack5",
    options: {}
  },

  webpackFinal: async (config) => {
    config.module.rules.push(
      {
        test: /\.less$/i,
        use: [
          { loader: 'style-loader' },
          { loader: 'css-loader', options: { modules: false } },
          { loader: 'less-loader', options: { implementation: require("less") } },// NOTE implementation为了解决less-loader无法找到less的情况，没有该配置，在storybook下回出现问题
        ]
      }
    );
    return config;
  },

  docs: {
    autodocs: true
  }
}